import request from "@/utils/request";

// 查询用户收藏列表
export function listFavorite(query) {
  return request({
    url: "/favorite/favorite/list",
    method: "get",
    params: query,
  });
}

// 查询用户收藏详细
export function getFavorite(favoriteId) {
  return request({
    url: "/favorite/favorite/" + favoriteId,
    method: "get",
  });
}

// 新增用户收藏
export function addFavorite(data) {
  return request({
    url: "/favorite/favorite",
    method: "post",
    data: data,
  });
}

// 修改用户收藏
export function updateFavorite(data) {
  return request({
    url: "/favorite/favorite",
    method: "put",
    data: data,
  });
}

// 删除用户收藏
export function delFavorite(favoriteId) {
  return request({
    url: "/favorite/favorite/" + favoriteId,
    method: "delete",
  });
}

// 取消用户收藏
export function delFavorite2(data) {
  return request({
    url: "/favorite/favorite/del2",
    method: "post",
    data: data,
  });
}

export function getFavoriteStatus(data) {
  return request({
    url: "/favorite/favorite/getFavoriteStatus",
    method: "post",
    data: data,
  });
}
